﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;

namespace ManagerMachine
{
    public class UpdateXML
    {
        XmlDocument myXmlDocument;
        
        public UpdateXML()
        {
            myXmlDocument = new XmlDocument();
        }
        public void ModifyNewPort(int TableID, int port, string path_config_table)
        {
            myXmlDocument.Load(path_config_table);
            XmlNode node;
            node = myXmlDocument.DocumentElement;
            foreach (XmlNode node1 in node.ChildNodes)
            {
                    if (node1.Name == "PORT")                    
                        node1.InnerText = port.ToString();

                    if (node1.Name == "TABLE_ID")
                        node1.InnerText = TableID.ToString();
            }
            myXmlDocument.Save(path_config_table);
        }

    }
}
